(define (combinations-cps lis num K)
  (K (iter-combinations-cps lis '() num (lambda (x) x))))


(define (iter-combinations-cps curlist product curnum K) 
  (cond 
    ((= curnum 0) (K (list product)))
    ((null? curlist) (K '()))
    (else
     (iter-combinations-cps (cdr curlist) product curnum 
                       (lambda (res-first)
                         (iter-combinations-cps (cdr curlist) (append product (list (car curlist))) (- curnum 1)
                          (lambda (res-second)
                            (K (append res-first res-second)))
                       ))
     
     )
  
  )))

(combinations-cps '(a b c d e f) 2 (lambda(x) x))
